Implementation of the diagnostic algorithm